var stationId=getParam("id");
var lon=getParam("lon");
var lat = getParam("lat");
console.log(stationId)
console.log(lon)
console.log(lat)
alert(stationId)
alert(lon)
alert(lat)
// stationId  = "85C56EDEB1916C4DE053C964A8C0515C",
// lon="113.633998";
// lat="34.747242"
var app = new Vue({
    el: '#app',
    data: {
        list: [],
        /* code: "3333333" //唯一码 终端编号
        electricity: "2" //1 直流 2交流
        gunAmount: "1"//充电枪数量
        id: "85C56EDEB1936C4DE053C964A8C0515C"
        num: "12120000"//桩位号
        power: "10" //额定功率
        standard: "2"//国家接口标准
        stationId: "85C56EDEB1916C4DE053C964A8C0515C"//所属充电站id
        status: "2" // 1使用中 2 空闲闲
        trademark: "85B19E8400215C23E053C964A8C0F3A2"//厂商id
        type: "G2"//型号
        voltage: "220" *///电压
        tabstate: 0,
        mescroll: null,
        lon:lon,
        lat:lat,
        chargeDetail: {//充电站详情
            /* all: "1", //充电桩数量
            allLeisure: "1", //所有空闲充电桩
            alternating: "1", // 交流充电桩空闲数量
            alternatingElectric: "0.70元/时 (交流)",//交流充电收费
            businessTime: "00:00-24:00", //营业时间
            direct: "0", //直流充电空闲数量
            directElectric: "0.90元/时 (直流)", //直流收费
            distance: "115", //距离
            id: "85C56EDEB1916C4DE053C964A8C0515C",
            img: null,
            isfloor: "0",  //0 地下 1地上
            lat: "34.74718",//经度
            lon: "113.633549", //维度
            name: "绿城广场请问",//名称
            num: "56565655", //充电站编号
            park: "0.00(参照停车场实际费用)", //停车场收费
            serve: "0.20元/时", //服务费
            site: "中原路绿城广场西门",//地址
            type: "1", */ //1 直流 2 交流 3混合
        }, 

    },
    mounted: function() {
        this.getDetail();
    },
    methods: {
        getDetail:function(){
            $ajax.get(apiUrl.stationGet,{
                stationId:stationId,
                lon:this.lon,
                lat:this.lat
            },function(res){
                document.title=res.data.name;
                app.chargeDetail=res.data;
                console.log(res,123)
            })
        },
        initmescroll:function(){
            if(this.mescroll)return;
            this.mescroll = new MeScroll("mescroll", { 
                up: {
                    callback:app.upCallback, 
                    page: {
                        num: 0, 
                        size: 10 
                    },
                    htmlNodata: '<p class="upwarp-nodata">-- END --</p>',
                    noMoreSize: 5
                }
            });
            this.mescroll.lockDownScroll(true);
        },
        upCallback:function(page){
            $ajax.get(apiUrl.list,{
                stationId:stationId,
                pageNum: page.num,
                pageSize: page.size,
                orderByColumn:'status',
                isAsc:'desc',
            },function(res){
                if(page.num==1){
                    app.list=[];
                }
                console.log(res,456)
                app.mescroll.endSuccess(res.rows.length);
                app.list=app.list.concat(res.rows);
            })
            
        },
        tabclick: function(index) {
            this.tabstate = index;
            if(index==1){
                this.initmescroll();
            }
        },
        getNearby: function() { //获取附近公交站点
            $ajax.get(apiUrl.route + stationId, {}, function(res) {
                console.log(res.data)
                app.list = res.data;
            })
        },
        seeSite: function(index) {
            openBusRouteStation({
                name: this.list[index].ROUTE_NAME,
                id: this.list[index].ID
            });
            // win_open(h5url + "/nearbyBusStop/busStop.html?id=" + thhis.list[index].Id, false, false)
        },
        nav:function(){
            console.log(this.chargeDetail)
            var data= {
                longitude : this.chargeDetail.lon,
                latitude : this.chargeDetail.lat,
                destination : this.chargeDetail.name,
                mapNaviType:1,// 0线路规划  1导航
            }
            openMapAutoNavi(data);
        }

    }

})
		       	